package com.guowei.web.controller;

import com.guowei.web.util.PathUtilFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class IndexController {

    @RequestMapping("/")
    public ModelAndView index(String path) {
        if (path == null || path.trim().equals("")) {
            path = "/";
        }
        String uri = PathUtilFactory.instance().path2Uri(path);
        return new ModelAndView("redirect:/explore" + uri);
    }
}
